<template>
  <div>son -- {{ msg }} <button @click="changemsg">changemsg</button>
    <hr>
    {{ count }} <button @click="changecount">changemsg</button>
  </div>
</template>

<script>
export default {
  props: {
    msg: {
      type: String,
      required: true
    },
    count: {
      type: Array,
      required: true
    }
  },
  methods: {
    changemsg() {
      // 自定义事件的格式update:修改的属性
      this.$emit('update:msg', '我爸姓王,我是小王子')
    },
    changecount() {
      this.$emit('update:count', [999])
    }
  }
}
</script>

<style>

</style>
